{extend name="public/base"/}
{block name="body"}
<title>加盟合作</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>加盟合作<span class="c-gray en">&gt;</span>合作流程<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
		<form class="form form-horizontal section" id="form-admin-add">
			<section>
					<input type="hidden" class="input-text" value="{$data.id}" id="id" name="id">
					<div class="row cl">
						<label class="form-label col-xs-3 col-sm-2">SEO关键词：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="text" class="input-text" value="{$data.seo_keywords}" id="seo_keywords" name="seo_keywords">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-3 col-sm-2">SEO描述：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="text" class="input-text" value="{$data.seo_description}" id="seo_description" name="seo_description">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-3 col-sm-2">左侧标题：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="text" class="input-text" value="{$data.title_l}" id="title_l" name="title_l">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-3 col-sm-2">左侧副标题：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="text" class="input-text" value="{$data.subtitle_l}" id="subtitle_l" name="subtitle_l">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-3 col-sm-2">标题：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="text" class="input-text" value="{$data.title}" id="title" name="title">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-3 col-sm-2">详情：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<script id="editor" name="detail" type="text/plain" style="width:100%;height:400px;">{:htmlspecialchars_decode($data.detail)}</script>
						</div>
					</div>
			</section>

			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-3 col-sm-offset-2">
					<input id="submit" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
				</div>
			</div>
		</form>
		
</article>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/public/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/public/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/public/static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="/public/static/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="/public/static/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="/public/static/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
$(function(){
	var ue = UE.getEditor('editor');
});
$("#submit").click(function() {
	layer.load(1, {
	  shade: [0.1,'#fff'] //0.1透明度的白色背景
	});
	var subtitle_l=$("input[name=subtitle_l]").val();
	var title_l=$("input[name=title_l]").val();
	var title=$("input[name=title]").val();
	var seo_keywords=$("input[name=seo_keywords]").val();
	var seo_description=$("input[name=seo_description]").val();
	var detail=UE.getEditor('editor').getContent();
	$.ajax({
	    type: 'POST',
	    url: "{:url('cooperate_process')}",
	    data: {title:title,title_l:title_l,subtitle_l:subtitle_l,detail:detail,seo_description:seo_description,seo_keywords:seo_keywords},
	    success: function(resdata){
	        if(resdata.code==200){
				layer.msg(resdata.msg,{icon:1,time:1000});
				setTimeout("location.reload()",1000);
	        }else{
				layer.msg(resdata.msg,{icon:2,time:3000});
	        }
	    },
	    error: function(){
			layer.msg('数据保存失败',{icon:2,time:3000});
	    }
	})
	
    
})
</script> 

{/block}